package org.csmz.class2333.filedome;
import java.io.File;
import java.io.IOException;

public class Example03 {
    public static void main(String[] args) throws IOException{
        File f1 = new File("E:\\file\\itheima.txt");
        if (f1.exists()){
            System.out.println("删除文件itheima.txt"+f1.delete());
        }else {
            System.out.println("创建文件itheima.txt:"+f1.createNewFile());
        }
        File f2 = new File("D:\\file\\cxk");
        System.out.println("创建目录cxk："+f2.mkdir());
        File f3 = new File("D:\\file\\cxk\\basketball.docx");
        if (f3.exists()){
            System.out.println("删除文件basketball.docx:"+f3.delete());
        }else {
            System.out.println("在目录cxk下创建文件basketball.docx:"+f3.createNewFile());
        }
    }
}
